from tkinter import *


root = Tk()
root.title('计算器')
root.geometry('370x300+200+200')

e1 = Entry(root,width=50)
e1.grid(row=0,column=0,columnspan=4,pady=5)

b11 = Button(root,text='MC').grid(row=1,column=0,sticky=NSEW)  # nsew可以占满整个单元格
b12 = Button(root,text='M+').grid(row=1,column=1,sticky=NSEW)
b13 = Button(root,text='M-').grid(row=1,column=2,sticky=NSEW)
b14 = Button(root,text='MM').grid(row=1,column=3,sticky=NSEW)

b21 = Button(root,text='0').grid(row=2,column=0,sticky=NSEW)
b22 = Button(root,text='1').grid(row=2,column=1,sticky=NSEW)
b23 = Button(root,text='2').grid(row=2,column=2,sticky=NSEW)
b23 = Button(root,text='3').grid(row=2,column=3,rowspan=2,sticky=NSEW)

b31 = Button(root,text='4').grid(row=3,column=0,columnspan=2,sticky=NSEW)
b32 = Button(root,text='5').grid(row=3,column=2,sticky=NSEW)


# b33 = Button(root,text='2').grid(row=3,column=4,rowspan=2)

root.mainloop()